<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.nce.util.LoginUserUtil"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>特用系统 导入数据</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/css/yui.css" type="text/css" rel="stylesheet"/>
	<link href="${ctx}/css/style.css" type="text/css" rel="stylesheet"/>
	<link href="${ctx}/css/colorbox.css" rel="stylesheet" type="text/css" />
	<link type="text/css" href="${ctx}/css/ui.all.css" rel="stylesheet" />
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<script src="${ctx}/js/jquery.colorbox.js" type="text/javascript"></script>
	<script src="${ctx}/js/table.js" type="text/javascript"></script>
	<script type="text/javascript" src="${ctx}/js/ui.core.js"></script>
	<script type="text/javascript" src="${ctx}/js/ui.datepicker.js"></script>
	<script type="text/javascript" src="${ctx}/js/ui.datepicker-zh_CN.js"></script>
	<script>
		
		function datePicker(pickerName,locale) {
			$(pickerName).datepicker($.datepicker.regional[locale]);
			$(pickerName).datepicker('option', 'changeMonth', true);//月份可调
			$(pickerName).datepicker('option', 'changeYear', true);//年份可调
		}
	
		$(document).ready(function() {				
			datePicker('#sdate','zh_CN');
			datePicker('#edate','zh_CN');	
		    $("#gen_report_btn").click(function() {//start		
		    	if ($('#sdate').val() == ''|| $('#edate').val() == '') {
				
			      alert('日期不能为空')
				  return false;
	        	}    
		   	    $("#gen_report_form").submit();		   	    
				return false;
			});	 //end 
	  		
		});
		
		function cleanMsg(){
			if (confirm("是否确认要清除所有的消息,如果清除将不可恢复,只能重新导入."))  {  
				sd = $('#sdate').val();
				location.href="${ctx}/admin/msg!cleanMsg.action?sd="+sd+"&ed="+$('#edate').val();
			}  else  { 				
			};
		}
		
</script>
</head>
<body>
<div id="doc3">
		<%@ include file="/common/header.jsp" %>
		<div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
		<div id="body" align="center">
		请注意导出的数据文件不要有重复,比如昨天导入过20120801的消息,今天又重复导入. <br>		
		<form id="gen_report_form" action="${ctx}/admin/msg!importMsg.action">
		<div>
		${msg}
		</div>
		<table class="report_table" cellpadding="0" cellspacing="0">
		<tr><td>开始日期:<input type="text" id="sdate" name="sdate"/></td><td>结束日期:<input type="text" id="edate" name="edate"/></td></tr>	
		<tr>		
		<td>文件路径(不要有中文,示例:d:/msg.txt):</td><td width="400px" ><input type="text" style="width:400px;" value="" name="filepath"/></td>	
		</tr>			
		</table>			
			<input id="gen_report_btn" type="button"  value="开始导入所有数据" />
			<input id="stats_btn" type="button" onclick="cleanMsg();" value="清除数据" />
			
		</div>
		</form>
		<%@ include file="/common/footer.jsp" %>
		</div>
	</body>
</html>